//
//  FCGKit.m
//  CPETEcgModule
//
//  Created by moon_zm on 2024/5/15.
//

#import "FCGKit.h"
#import <vhFCGKit/vhFCGKit-Swift.h>

@interface FCGKit()
@property (nonatomic, strong) vhFCGKit *vhFcgKit;
@end
@implementation FCGKit

/// Constructor
/// \param me hspecg@163.com
///
- (instancetype)init {
    self = [super init];
    if (self) {
        self.vhFcgKit = [[vhFCGKit alloc] initWithMe:@"hspecg@163.com"];
    }
    return self;
}

/// Is initialization successful?
///
/// returns:
///
/// true or false
- (BOOL)isOK {
    return [self.vhFcgKit isOK];
}
/// Set patient’s information
/// \param ageY patient’s age in years
///
/// \param gender Patient sex: ‘M’ or ‘F’
///
/// \param cmHeight Patient Height in cm
///
/// \param kgWeight Patient Weight in kg
///
- (void)SetPatientInfoWithAgeY:(int32_t)ageY gender:(int8_t)gender cmHeight:(float)cmHeight kgWeight:(float)kgWeight {
    [self.vhFcgKit SetPatientInfoWithAgeY:ageY gender:gender cmHeight:cmHeight kgWeight:kgWeight];
}
- (void)SetRiskFactorsWithMVP:(BOOL)MVP Migraine:(BOOL)Migraine CADsymp:(int32_t)CADsymp DiabetesMellitus:(int32_t)DiabetesMellitus HighCholesterol:(BOOL)HighCholesterol HighBP:(BOOL)HighBP Smooking:(BOOL)Smooking HeartCondition:(int32_t)HeartCondition SigStress:(BOOL)SigStress {
    [self.vhFcgKit SetRiskFactorsWithMVP:MVP Migraine:Migraine CADsymp:CADsymp DiabetesMellitus:DiabetesMellitus HighCholesterol:HighCholesterol HighBP:HighBP Smooking:Smooking HeartCondition:HeartCondition SigStress:SigStress];
}
- (BOOL)SetData12WithData:(NSArray<NSArray<NSNumber *> *> * _Nonnull)data SampleRate:(int16_t)SampleRate uVpb:(double)uVpb msRR:(int16_t)msRR {
    return [self.vhFcgKit SetData12WithData:data SampleRate:SampleRate uVpb:uVpb msRR:msRR];
}
- (float)Getdf {
    return [self.vhFcgKit Getdf];
}
- (NSArray<NSNumber *> * _Nonnull)GetPsdWithLead:(int16_t)lead {
    return [self.vhFcgKit GetPsdWithLead:lead];
}
- (NSArray<NSNumber *> * _Nonnull)GetPhase {
    return [self.vhFcgKit GetPhase];
}
- (NSArray<NSNumber *> * _Nonnull)GetPulseResponse {
    return [self.vhFcgKit GetPulseResponse];
}
- (NSArray<NSNumber *> * _Nonnull)GetR51Score {
    return [self.vhFcgKit GetR51Score];
}
- (int32_t)GetCadNo {
    return [self.vhFcgKit GetCadNo];
}
- (int32_t)GetIschemiaSeverity {
    return [self.vhFcgKit GetIschemiaSeverity];
}
- (int32_t)GetCADPresence {
    return [self.vhFcgKit GetCADPresence];
}
- (int32_t)GetCALVO {
    return [self.vhFcgKit GetCALVO];
}
- (NSArray<NSNumber *> * _Nonnull)IndexPsdWithLead:(int16_t)lead {
    return [self.vhFcgKit IndexPsdWithLead:lead];
}
- (NSArray<NSNumber *> * _Nonnull)IndexPhase {
    return [self.vhFcgKit IndexPhase];
}
- (NSArray<NSNumber *> * _Nonnull)IndexImpulseResponse {
    return [self.vhFcgKit IndexImpulseResponse];
}

- (UIImage *)getCadImg:(int32_t)cadNo {
    NSBundle *frameworkBundle = [NSBundle bundleForClass:[vhFCGKit class]];
    NSString *name = [NSString stringWithFormat:@"%02d", cadNo];
    NSString *imagePath = [frameworkBundle pathForResource:name ofType:@"jpg"];
    return [UIImage imageWithContentsOfFile:imagePath];
}


@end
